<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">

    <body>

        <ui:composition template="../templates/default3.xhtml">          

            <ui:define name="content">
                <h:form id="updateRole" binding="#{roleManagerBean.loadUpdateRole}">
                    <p:panel id="roleinfo" header ="Role Information">
                        <font class="fieldNote">*- Mandatory Field</font>
                        <p:messages/>
                        <table class="panel">
                            <tr>
                                <td>
                                    Role title</td>
                                <br></br>
                                <td>
                                    <table>
                                        <tr>
                                            <td><b><h:outputText id="role" value="#{roleManagerBean.roleType}"> 

                                                    </h:outputText> </b>&nbsp;

                                            </td>

                                        </tr>
                                    </table>
                                </td>

                            </tr>
                            <tr>
                                <td>
                                    Role description </td>
                                <br></br>
                                <td>
                                    <table>
                                        <tr>
                                            <td><p:inputTextarea required="true" id="description" style="width:300px;height:100px;" effectDuration="400" requiredMessage="Role Description required" value="#{roleManagerBean.description}"> 
                                                </p:inputTextarea> 
                                            </td>
                                            <td>    <font class="fieldNote">*</font>
                                            </td>
                                        </tr>
                                    </table>
                                </td>

                            </tr>

                            <tr>
                                <td align="right">

                                </td>
                            </tr>

                            <tr>

                                <td class="btn" colspan="3"><hr/> 
                                    <p:commandButton id="btnDone" value="Done" actionListener="#{roleManagerBean.doneUpdate}" ajax="true" update="updateRole"  />
&nbsp;&nbsp;&nbsp;
                                    <p:commandButton value="Remove" onclick="confirmation.show()" />

                                    <p:confirmDialog message="Are you sure about removing this role?"
                                                     header="Remove Role" severity="alert" widgetVar="confirmation">

                                        
                                        
                                        
                                                                                <table width="100%">
                                            <tr>
                                                <td align="center">
                                                    <p:commandButton value="Yes" oncomplete="confirmation.hide()"  actionListener="#{roleManagerBean.removeRole}" />
                                        &nbsp;&nbsp;&nbsp;<p:commandButton value="No" onclick="confirmation.hide()" /> 
                                                </td>
                                            </tr>
                                        </table>
                                        
                                    </p:confirmDialog><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
                                </td>
                            </tr>
                        </table>
                    </p:panel>
                </h:form>
            </ui:define>        
        </ui:composition>
    </body>
</html>
